<?php

namespace app\common\model;

use think\Model;

class FollowUp extends Model
{
    protected $name = 'crm_follow_up';

    protected $autoWriteTimestamp = true;
    protected $createTime = 'create_time';
    protected $updateTime = 'update_time';
    protected $deleteTime = 'delete_time';

    protected $type = [
        'images' => 'json',
    ];

    // 关联客户
    public function customer()
    {
        return $this->belongsTo('app\common\model\CrmCustomers', 'customer_id', 'id');
    }

    // 关联跟进人
    public function user()
    {
        return $this->belongsTo('app\common\model\User', 'user_id', 'id');
    }

    // 关联陪同人
    public function partner()
    {
        return $this->belongsTo('app\common\model\User', 'partner_id', 'id');
    }
}